﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Meqs.Entity;
using Meqs.Logic.Interface;
using System.Collections.Generic;

public partial class Custom_ucResearch : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            repeatResearch.DataSource = GetAllSubjects();
            repeatResearch.DataBind();
        }
    }

    /// <summary>
    /// 获取所有局级科目
    /// </summary>
    /// <returns></returns>
    private List<GlobalCauseInfo> GetAllSubjects()
    {
        IGlobalCauseInfoLogic subjectLogic = Container<IGlobalCauseInfoLogic>.Instance;
        List<GlobalCauseInfo> list = (List<GlobalCauseInfo>)subjectLogic.FindAll();

        foreach (GlobalCauseInfo item in list)
        {
            item.CauseName += "组";
        }

        GlobalCauseInfo item2 = new GlobalCauseInfo();
        item2.CauseName = "全部";
        item2.RID = 0;
        list.Insert(0, item2);

        return list;
    }
}
